#pragma once
#include<iostream>
#include <assert.h>

using namespace std;
class Date
{
public:
	int GetMonthDay(int year, int month)
	{
		assert(month > 0 && month < 13);
		static int Montharry[13]={0,31, 28, 31, 30, 31, 30,
31, 31, 30, 31, 30, 31 };
		if (month == 2 &&
			((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)))
		{
			return 29;
		}

		return Montharry[month];
	}

	Date operator+(int day) const;
	Date& operator+=(int day);

	Date operator-(int day) const;
	Date& operator-=(int day);

	bool operator<(const Date& d) const;
	bool operator<=(const Date& d) const;
	bool operator>(const Date& d) const;
	bool operator>=(const Date& d) const;
	bool operator==(const Date& d) const;
	bool operator!=(const Date& d) const;

	// d1++;
	// d1.operator++(0);
	Date operator++(int);

	// ++d1;
	// d1.operator++();
	Date& operator++();

	// d1--;
	// d1.operator--(0);
	Date operator--(int);

	// --d1;
	// d1.operator--();
	Date& operator--();

	int operator-(const Date& d) const;
private:
	int _year;
	int _month;
	int _day;
};


